package frist50;

import org.junit.jupiter.api.Test;

public class T0050 {
    public double myPow(double x, int n) {
        long ln=n;
        if (n < 0) {
            x=1/x;
            ln=-ln;
        }
        double re = 1;
        while (ln != 0) {
            if ((ln & 1) == 1) {
                re *= x;
            }
            ln = ln >> 1;
            x = x * x;
        }
        return re;
    }

    @Test
    public void test() {
        System.out.println(myPow(1, Integer.MIN_VALUE));
    }
}
